//
//  MyRepariStateTableViewCell.m
//  PropertyManager
//
//  Created by TNG on 2018/7/19.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "MyRepariStateTableViewCell.h"

@implementation MyRepariStateTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.separatorInset = UIEdgeInsetsMake(0, 0, 0, MAXFLOAT);
    }
    return self;
}

-(void)creatUI{
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.timeLabel];
    [self.contentView addSubview:self.stateLabel];
}

-(UILabel *)titleLabel
{
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, WIDTH - 160, 26)];
        _titleLabel.font = font(16);
        _titleLabel.textColor = SFM51;
        _titleLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _titleLabel;
}

-(UILabel *)timeLabel
{
    if (_timeLabel == nil) {
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 50, WIDTH - 40, 18)];
        _timeLabel.font = font(12);
        _timeLabel.textColor = SFM153;
        _timeLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _timeLabel;
}

-(UILabel *)stateLabel
{
    if (_stateLabel == nil) {
        _stateLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH - 140, 20, 120, 26)];
        _stateLabel.font = font(12);
        _stateLabel.textColor = SFM153;
        _stateLabel.textAlignment = NSTextAlignmentRight;
    }
    return _stateLabel;
}

-(void)send
{
    self.titleLabel.text = @"修走廊灯";
    self.timeLabel.text = @"期望维修时间：2018-09-08";
    self.stateLabel.text=@"已完成";
}

-(void)sendRepariModel:(RepariModel *)model
{
    self.titleLabel.text = model.bxrTel;
    self.timeLabel.text = [NSString stringWithFormat:@"期望维修时间：%@",model.bxDate];;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
